﻿using GalaSoft.MvvmLight;
using Newtonsoft.Json;
using POGOProtos.Inventory.Item;
using PokemonGo.RocketAPI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace PokemonGo.UI.Common
{
    [JsonObject(MemberSerialization.OptIn)]
    public class RecycleItem : INotifyPropertyChanged
    {

        private ItemId _itemId;
        [JsonProperty]
        public ItemId Key
        {
            get { return _itemId; }
            set
            {
                if (_itemId != value)
                {
                    _itemId = value;
                    this.RaisePropertyChanged("Key");
                }
            }
        }


        private int _value = 0;


        [JsonProperty]
        public int Value
        {
            get { return _value; }
            set
            {
                if (_value != value)
                {
                    _value = value;
                    this.RaisePropertyChanged("Value");
                }
            }
        }

        
        public RecycleItem(ItemId iid, int value)
        {
            Key = iid;
            Value = value;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        public virtual void RaisePropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if (propertyChanged != null)
            {
                propertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }


    }
}
